<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/vectrics.tld"    prefix="vectrics" %>


<%@ page import="org.vectrics.recruiter.job.Job" %>
<%@ page import="org.apache.log4j.Logger" %>
<%@ page import="org.vectrics.recruiter.struts.*" %>
<%@ page import="org.vectrics.domain.Domain" %>
<%@ page import="org.vectrics.hibernate.ThreadProperties" %>


<vectrics:errors/>



<%
	Domain domain = ThreadProperties.getDomain();
	String domainId = domain.getId().toString();
	String personId = request.getParameter("personId");
	String jobAgentId = request.getParameter("jobAgentId");
	JobAgentForm form = (JobAgentForm)request.getAttribute("jobAgentForm");

	String domainUriId = ThreadProperties.getUriDomainId();
	String formAction = "/profile/" + domainUriId + "/agent/save";
	
	String locationCode1 = form.getLocationId1();
	String locationCode2 = form.getLocationId2();
	String locationCode3 = form.getLocationId3();
	
	String functionCode1 = form.getFunctionCode1();
	String functionCode2 = form.getFunctionCode2();
	String functionCode3 = form.getFunctionCode3();
%>


<html:form action="<%=formAction%>" method="POST">
	<html:hidden property="personId"/>
	<html:hidden property="jobAgentId"/>
	<table>
		<tr>
			<td valign="TOP">
				<table width="600" cellpadding="4" cellspacing="1">
					<tr>
						<td class="formBg1" valign="top">
							<font class="formLabelClass">Name</font>
							<vectrics:errors property="name"/>
						</td>
						<td class="formBg1" valign="top">
							<html:text property="name" styleClass="formEditClass" maxlength="80"/>
						</td>
					</tr>
				
					<tr>
						<td class="formBg2" valign="top">
							<font class="formLabelClass">Search Words</font>
							<vectrics:errors property="searchWords"/>
						</td>
						<td class="formBg2" valign="top">
							<html:text property="searchPhrase" styleClass="formEditClass" maxlength="80"/>
						</td>
					</tr>

					<tr>
						<td class="formBg1" valign="top">
							<font class="formLabelClass">Location</font>
							<vectrics:errors property="location1"/>
						</td>
						<td class="formBg1" valign="top">
							<vectrics:locationCombo 
								property="locationId1" 
								domainId="<%=domainId%>" 
								locationType="job.location"
								styleClass="formComboClass" 
								selected="<%=locationCode1%>" 
								none="true"/><br>
							<vectrics:locationCombo 
								property="locationId2" 
								domainId="<%=domainId%>" 
								locationType="job.location"
								styleClass="formComboClass" 
								selected="<%=locationCode2%>" none="true"/><br>
							<vectrics:locationCombo 
								property="locationId3" 
								domainId="<%=domainId%>" 
								locationType="job.location"
								styleClass="formComboClass" 
								selected="<%=locationCode3%>" 
								none="true"/>
						</td>
					</tr>
					<tr>
						<td class="formBg2" valign="top">
							<font class="formLabelClass">Job Function</font>
						</td>
						<td class="formBg2" valign="top">
							<vectrics:jobFunctionCombo property="functionCode1" styleClass="formComboClass" value="<%=functionCode1%>" none="true"/><br>
							<vectrics:jobFunctionCombo property="functionCode2" styleClass="formComboClass" value="<%=functionCode2%>" none="true"/><br>
							<vectrics:jobFunctionCombo property="functionCode3" styleClass="formComboClass" value="<%=functionCode3%>" none="true"/>
						</td>
					</tr>
					
					<tr>
						<td class="formBg1" valign="TOP" align="left"></td>
						<td class="formBg1" valign="TOP" align="left">
							<vectrics:formButton name="submit" code="public.button.ok" phraseCode="button.ok"/>
							&nbsp;
							<vectrics:formButton name="cancel" code="public.button.cancel" phraseCode="button.cancel"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</html:form>